package org.example.sunrise.utils;

import javafx.scene.Cursor;
import javafx.scene.Scene;
import javafx.scene.control.Button;

import java.util.function.Supplier;

public class ButtonUtil {
    public static Button createMenuTransparentButton(double x, double y, double w, double h) {
        Button btn = new Button();
        btn.setLayoutX(x);
        btn.setLayoutY(y);
        btn.setPrefWidth(w);
        btn.setPrefHeight(h);
        btn.setOpacity(0);
        return btn;
    }

    public static void setHandCursor(Button btn,  Supplier<Scene> supplier) {
        btn.setOnMouseEntered(event -> supplier.get().setCursor(Cursor.HAND));
        btn.setOnMouseExited(event -> supplier.get().setCursor(Cursor.DEFAULT));
    }
}
